Skip to content

[container_upgrade] Convert parameters.json from string to list format#23343

Merged
wangxinbot merged 1 commit intosonic-net:masterfrom
wangxinbot:xiwang5/container-upgrade-list-format
Mar 30, 2026
Merged

[container_upgrade] Convert parameters.json from string to list format#23343
wangxinbot merged 1 commit intosonic-net:masterfrom
wangxinbot:xiwang5/container-upgrade-list-format

Conversation

@wangxinbot
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Convert docker parameters in parameters.json from single string format to list format for better readability and to align with the internal repo format, reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces, producing the same runtime result as before.

Type of change

  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

The internal repo uses list format for docker parameters in parameters.json, while the public repo uses string format. This difference causes merge conflicts every time we sync public to internal. By aligning the format, future syncs will be clean.

How did you do it?

  1. Converted parameters.json entries from strings (e.g., "param1 param2") to lists (e.g., ["param1", "param2"])
  2. Updated create_parameters_mapping() in container_upgrade_helper.py to use ' '.join(details['parameters']) to reconstruct the string at runtime

How did you verify/test it?

The create_parameters_mapping() function joins the list back into a space-separated string, producing identical output to the previous string format. The docker run commands are unchanged.

Any platform specific information?

N/A

Supported testbed topology if it's a new test case?

N/A - existing test improvement

Documentation

N/A

Convert docker parameters from single string format to list format
for better readability and to align with the internal repo format,
reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces,
producing the same runtime result as before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wangxinbot
Copy link
Copy Markdown
Contributor Author

@maipbui Can you help review this change?

Copy link
Copy Markdown
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. String-to-list conversion is clean and runtime behavior is identical (\' '.join([])\ == \''\). @wangxinbot

@wangxinbot wangxinbot merged commit 7e070f6 into sonic-net:master Mar 30, 2026
18 of 19 checks passed
r12f pushed a commit to r12f/sonic-mgmt that referenced this pull request Mar 31, 2026
sonic-net#23343)

Convert docker parameters from single string format to list format
for better readability and to align with the internal repo format,
reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces,
producing the same runtime result as before.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
Co-authored-by: Xin Wang <xiwang5@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Apr 1, 2026
sonic-net#23343)

Convert docker parameters from single string format to list format
for better readability and to align with the internal repo format,
reducing merge conflicts during public-to-internal sync.

Update create_parameters_mapping() to join the list with spaces,
producing the same runtime result as before.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
Co-authored-by: Xin Wang <xiwang5@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants